package org.smile.homework01.kevin.MemberCard;

import java.util.HashMap;
import java.util.Map;

public class CardFactory {
    private Map<String,CreatCard> cardMap = new HashMap();
    public CreatCard getMemberCard(String str){
        CreatCard memberCard = cardMap.get(str);
        if(memberCard == null){
            System.out.println("会员卡ID不存在，将创建新会员：");
            memberCard = new MemberCard(str);
            cardMap.put(str, memberCard);
        }
        return memberCard;
    }
    public int getMemberCardMapSize(){
        return cardMap.size();
    }
}
